package com.ruiysoft.controller.sys.api;

import com.ruiysoft.controller.sys.res.BrowsedShopResponse;
import com.ruiysoft.controller.sys.res.EntryUserResponse;
import com.ruiysoft.controller.sys.res.ShopResponse;
import com.ruiysoft.controller.sys.res.UserResponse;
import com.ruiysoft.controller.sys.res.UserShopResponse;
import com.ruiysoft.entity.sys.SysUser;
import com.ruiysoft.pub.core.Result;
import com.ruiysoft.pub.entity.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by 化增光 on 2019/1/4.
 */
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2018-11-02T18:10:17.406+08:00")

@Api(value = "sysuser", description = "the sysuser pc API")
public interface SysUserApi {

    @ApiOperation(value = "获取我的店铺列表", nickname = "getUserShops", notes = "", response = BrowsedShopResponse.class, responseContainer = "List", tags={ "PC用户接口", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "successful operation", response = BrowsedShopResponse.class, responseContainer = "List") })
    @RequestMapping(value = "/user/shops",
            produces = { "application/json" },
            method = RequestMethod.GET)
    Result<List<UserShopResponse>> getUserShops();

    @ApiOperation(value = "获取PC登录用户基本信息", nickname = "getLoginOnUser", notes = "", response = UserResponse.class, tags={ "小程序端用户接口", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "successful operation", response = UserResponse.class) })
    @RequestMapping(value = "/user/getloginOnUser",
            produces = { "application/json" },
            method = RequestMethod.GET)
    Result<EntryUserResponse> getLoginOnUser();


    @ApiOperation(value = "获取店铺列表", nickname = "getUserShops", notes = "", response = BrowsedShopResponse.class, responseContainer = "List", tags={ "PC用户接口", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "successful operation", response = BrowsedShopResponse.class, responseContainer = "List") })
    @RequestMapping(value = "/inner/shops",
            produces = { "application/json" },
            method = RequestMethod.GET)
    Result<PageInfo<UserShopResponse>> getInnerUserShops(@NotNull @ApiParam(value = "分页开始页", required = true) @Valid @RequestParam(value = "pageStart", required = true) Integer pageStart, @NotNull @ApiParam(value = "每页显示多少条数据", required = true) @Valid @RequestParam(value = "pageSize", required = true) Integer pageSize);

//    @ApiOperation(value = "选择登录的店铺", nickname = "chooseBrowsedShop", notes = "", tags={ "PC端用户接口", })
//    @ApiResponses(value = {
//            @ApiResponse(code = 200, message = "successful operation") })
//    @RequestMapping(value = "/user/chooseUserShop",
//            produces = { "application/json" },
//            method = RequestMethod.POST)
//    Result<Void> chooseUserShop(@ApiParam(value = "店铺主键") @Valid @RequestParam(value = "shopId", required = true) Long shopId);
//
//    @ApiOperation(value = "获取登录店铺基本信息", nickname = "getShopById", notes = "", response = ShopResponse.class, tags={ "PC端店铺接口", })
//    @ApiResponses(value = {
//            @ApiResponse(code = 200, message = "successful operation", response = ShopResponse.class) })
//    @RequestMapping(value = "/user/shop",
//            produces = { "application/json" },
//            method = RequestMethod.GET)
//    Result<ShopResponse> getUserLoginShop();


    @ApiOperation(value = "获取店铺店主", nickname = "getShopkeeper", notes = "", response = ShopResponse.class, tags={ "根据店铺获取店主", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "successful operation", response = ShopResponse.class) })
    @RequestMapping(value = "/user/shopkeeper",
            produces = { "application/json" },
            method = RequestMethod.GET)
    Result<SysUser> getShopkeeper(Long shopId);

    @ApiOperation(value = "删除用户信息", nickname = "deleteSysUserById", notes = "", response = ShopResponse.class, tags={ "删除用户", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "successful operation", response = ShopResponse.class) })
    @RequestMapping(value = "/user/delete/{id}",
            produces = { "application/json" },
            method = RequestMethod.GET)
    Result<Void> deleteSysUserById(@PathVariable("id") Long id);
}
